<style lang='scss' scoped>
	.ALLlist {
		margin: 0 20rpx;

		.list {
			display: flex;

			image {
				flex: 1;
				box-sizing: border-box;
				padding: 10rpx;
			}

			.warp {
				width: 400rpx;
				box-sizing: border-box;
				padding: 10rpx;
				display: flex;
				flex-direction: column;
				justify-content: space-between;

				.title {
					overflow: hidden;
					text-overflow: ellipsis;
					white-space: nowrap;
				}

				.footer {
					.price {
						font-size: 35rpx;
						color: red;
					}
				}
			}
		}
	}
</style>
<template>
	<view class="ALLlist">
		<view class="list" v-for="(item,index) in list" :key="index" @click="gocourse(item.id)">
			<image v-if="item.cover!=='null'" :src="item.cover" mode="widthFix"></image>
			<image v-else src="../../static/logo.png" mode="widthFix"></image>
			<div class="warp">
				<view class="title">
					{{item.title}}
				</view>
				<div class="footer">
					<text class="price">¥{{item.price}}</text>
					<text>¥{{item.t_price}}</text>
				</div>
			</div>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			list: Array
		},
		data() {
			return {}
		},
		onLoad(o) {},
		methods: {
			gocourse(id) {
				uni.navigateTo({
					url: `/pages/course/course?id=${id}`
				})
			}
		}
	}
</script>
